from googletrans import Translator

def enToCn(text_to_translate):
    # 创建翻译器实例
    translator = Translator()

    # 要翻译的文本
    # text_to_translate = "Hello, how are you?"

    # 使用translate方法翻译文本，指定目标语言为中文（zh-cn）
    translated_text = translator.translate(text_to_translate, dest='zh-cn').text

    return translated_text

if __name__ == '__main__':
    print(enToCn("Hello, how are you?"))